/**
 * jims
 */
package com.jims.master.modules.doctor.area.entity;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.jims.master.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

/**
 * Entity
 * @author chent
 * @version 2017-06-10
 */
public class SysArea extends DataEntity<SysArea> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// code
	private String name;		// 区域名称
	private String parentCode;		// 父级编号
	private String group;		// group
	private String pinyin;		// pinyin
	private String type;		// 区域类型
	private String parentIds;		// parent_ids
	private SysArea parentId;		// parent_id
	private String sort;		// sort
	private String parent;		// parent

	
	public SysArea() {
		super();
	}

	public SysArea(String id){
		super(id);
	}

	@Length(min=1, max=8, message="code长度必须介于 1 和 8 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=1, max=100, message="区域名称长度必须介于 1 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=8, message="父级编号长度必须介于 0 和 8 之间")
	public String getParentCode() {
		return parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}
	
	@Length(min=0, max=1, message="group长度必须介于 0 和 1 之间")
	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}
	
	@Length(min=0, max=30, message="pinyin长度必须介于 0 和 30 之间")
	public String getPinyin() {
		return pinyin;
	}

	public void setPinyin(String pinyin) {
		this.pinyin = pinyin;
	}
	
	@Length(min=0, max=1, message="区域类型长度必须介于 0 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=0, max=2000, message="parent_ids长度必须介于 0 和 2000 之间")
	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	
	@JsonBackReference
	public SysArea getParentId() {
		return parentId;
	}

	public void setParentId(SysArea parentId) {
		this.parentId = parentId;
	}
	
	@Length(min=0, max=10, message="sort长度必须介于 0 和 10 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}
	
	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}
	
}